// 负荷率
var myColor = ['#9298fa', '#4ab6f5', '#61dddb', '#83fa9e', '#caf96d'];
var optionLoadRate = {
    backgroundColor: '#373945',
    grid: {
        containLabel: true,
        right: rem,
        top: 0,
        bottom: 0,
        left: 0
    },
    tooltip: {
        trigger: 'item',
        textStyle: {
            align:'left',
            fontSize: 0.24 * rem
        },
        confine: true,
        formatter: function (params) {
            return params.name + '：' + fix2(optionLoadRate.series[0].data[params.dataIndex]) + '%';
        }
    },
    xAxis: {
        show: false
    },
    yAxis: [{
        show: true,
        data: ['马桥社卫', '古美社卫', '闵妇保', '莘庄社卫', '浦江社卫'],
        inverse: true,
        axisLine: {show: false},
        splitLine: {show: false},
        axisTick: {show: false},
        axisLabel: {show: false}

    }],
    series: [{
        name: '条',
        type: 'bar',
        z: 23,
        barWidth: 16,
        data: [90, 85, 64, 54, 52],
        itemStyle: {
            normal: {
                barBorderRadius: [0, 30, 30, 0],
                color: function(params) {
                    var num = myColor.length;
                    return myColor[params.dataIndex % num]
                },
            }
        },
        label: {
            normal: {
                show: false
            }
        }
    }, {
        name: '框',
        type: 'bar',
        barGap: '-100%',
        barWidth: 16,
        data: [100, 100, 100, 100, 100],
        itemStyle: {
            normal: {
                color: '#c3c4c8',
                barBorderRadius: [0, 30, 30, 0],
            }
        },
        label: {
            normal: {
                show: true,
                position: 'right',
                color: '#fff',
                fontSize: 0.24 * rem,
                formatter: function (params) {
                    return fix2(optionLoadRate.series[0].data[params.dataIndex]) + '%';
                }
            }
        }
    }]
};

// 所有设备、重点一级68分类，设备风险等级分类设备金额及数量接口
var optionAssets = {
    tooltip: {
        trigger: 'item',
        textStyle: {
            align:'left',
            fontSize: 0.24 * rem
        },
        confine: true
    },
    series: [{
        type: 'pie',
        hoverOffset: 3,
        startAngle: 180,
        radius: ['75%', '90%'],
        selectedMode: false,
        selectedOffset: 3,
        label: {
            normal: {
                formatter: function (param) {
                    if (param.dataIndex === 2) {
                        return '设备金额';
                    } else if (param.dataIndex === 4) {
                        return '508次';
                    } else {
                        return '';
                    }
                },
                position: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 0.24 * rem
                }
            }
        },
        data: [{
            value: '',
            name: '超声',
            itemStyle: {
                normal: {
                    color: '#50c0ff'
                }
            }
        }, {
            value: '',
            name: '电子仪器',
            itemStyle: {
                normal: {
                    color: '#63ddda'
                }
            }
        }, {
            value: '',
            name: '光学仪器',
            itemStyle: {
                normal: {
                    color: '#34f9aa'
                }
            }
        }, {
            value: '',
            name: '检验生化',
            itemStyle: {
                normal: {
                    color: '#caf86b'
                }
            }
        }, {
            value: '',
            name: '光学仪器',
            itemStyle: {
                normal: {
                    color: '#f7ff51'
                }
            }
        }, {
            value: '',
            name: '检验生化',
            itemStyle: {
                normal: {
                    color: '#9298f7'
                }
            }
        }]
    }, {
        type: 'pie',
        hoverOffset: 2,
        startAngle: 180,
        radius: ['55%', '70%'],
        label: {
            show: false
        },
        data: [{
            value: '',
            name: 'Ⅰ级',
            itemStyle: {
                normal: {
                    color: '#fdd951'
                }
            }
        }, {
            value: '',
            name: 'Ⅱ级',
            itemStyle: {
                normal: {
                    color: '#5cdbe1'
                }
            }
        }, {
            value: '',
            name: 'Ⅲ级',
            itemStyle: {
                normal: {
                    color: '#2e96d3'
                }
            }
        }]
    }]
};

// 服务人次
var optionPersonTimes = {
    tooltip: {
        trigger: 'item',
        textStyle: {
            align:'left',
            fontSize: 0.24 * rem
        },
        confine: true
    },
    series: [{
        type: 'pie',
        hoverOffset: 3,
        startAngle: 180,
        radius: ['75%', '90%'],
        selectedMode: false,
        selectedOffset: 3,
        label: {
            normal: {
                position: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 0.24 * rem
                }
            }
        },
        data: [{
            value: '',
            name: '平均故障时间',
            itemStyle: {
                normal: {
                    color: '#62dcdd'
                }
            }
        }, {
            value: '',
            name: '平均运行时间',
            itemStyle: {
                normal: {
                    color: '#2cfdaa'
                }
            }
        }, {
            value: '',
            name: '平均运行时间',
            itemStyle: {
                normal: {
                    color: '#84fba1'
                }
            }
        }, {
            value: '',
            name: '平均运行时间',
            itemStyle: {
                normal: {
                    color: '#c9f96f'
                }
            }
        }, {
            value: '',
            name: '平均运行时间',
            itemStyle: {
                normal: {
                    color: '#f7fc57'
                }
            }
        }, {
            value: '',
            name: '平均运行时间',
            itemStyle: {
                normal: {
                    color: '#9297fb'
                }
            }
        }]
    }]
};

// 医院服务人次列表接口(柱状折线图,排名,更多)
var optionHospital = {
    color: ['#2e9b74', '#28beea', '#ffde57'],
    tooltip: {
        trigger: "axis",
        axisPointer: {
            type: "shadow",
            textStyle: {
                color: "#fff"
            }
        },
    },
    grid: {
        top: 60,
        bottom: 30,
        left: 10,
        right: 10,
        containLabel: true
    },
    legend: {
        x: '40%',
        top: '3%',
        textStyle: {
            color: '#90979c',
        },
        data: ['设备金额', '门诊人次', '住院人次']
    },
    xAxis: [{
        type: 'category',
        data: [],
        axisLabel: {rotate: 30, fontWeight: 100, fontSize: 0.24 * rem, textStyle: {color: '#fff'}},
        nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
        splitLine: {show: false, lineStyle: {color: '#f00', type: 'dashed'}},
        axisLine: {lineStyle: {color: '#fff'}},
        axisTick: {lineStyle: {color: '#fff'}}
    }],
    "yAxis": [{
        name: '万元',
        type: 'value',
        splitLine: {lineStyle: {type: 'dashed'}},
        axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
        nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
        axisLine: {lineStyle: {color: '#fff'}},
        axisTick: {lineStyle: {color: '#fff'}}
    }, {
        name: '人次',
        type: 'value',
        splitLine: {show: false, lineStyle: {type: 'dashed'}},
        axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
        nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
        axisLine: {lineStyle: {color: '#fff'}},
        axisTick: {lineStyle: {color: '#fff'}}
    }],
    series: [{
        "name": '设备金额',
        "type": "bar",
        "stack": "总量",
        "barMaxWidth": 35,
        "data": [],
    }, {
        "name": '门诊人次',
        "type": "line",
        symbolSize:10,
        symbol:'circle',
        "data": []
    },{
        name: '住院人次',
        type: "line",
        symbolSize:10,
        symbol:'circle',
        data: []
    }
    ]
}

// 闵行区地图
var optionMap = {
    grid: {
        top: 0,
        right: 0,
        bottom: 0,
        left: 0
    },
    tooltip: {
        trigger: 'item',
        formatter: function (params) {
            console.log(params);
        }
    },
    geo: {
        show: true,
        map: 'minhang',
        label: {
            normal: {
                show: false,
                color: '#fff'
            },
            emphasis: {
                show: false
            }
        },
        aspectScale: 0.8,
        zoom: 1.2,
        roam: true,
        itemStyle: {
            normal: {
                borderWidth: 2,
                areaColor: '#666',
                borderColor: '#3ddaa7'
            },
            emphasis: {
                areaColor: '#666',
                borderColor: '#3ddaa7'
            }
        }
    },
    series: [{
        name: 'normal',
        type: 'effectScatter',
        coordinateSystem: 'geo',
        data: [],
        showEffectOn: 'render',
        rippleEffect: {
            brushType: 'stroke'
        },
        label: {normal: {show: false}},
        hoverAnimation: true,
        itemStyle: {
            normal: {
                color: '#fff',
                shadowBlur: 10,
                shadowColor: '#2bfd9a'
            }
        }
    }]
};